package cn.edu.gduf.luowowo.search.service.impl;

import cn.edu.gduf.luowowo.search.domain.TravelTemplate;
import cn.edu.gduf.luowowo.search.repository.TravelSearchRepository;
import cn.edu.gduf.luowowo.search.service.ITravelSearchService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;

import java.util.List;

@Service
public class TravelSearchServiceImpl implements ITravelSearchService {
    @Autowired
    private TravelSearchRepository repository;
    @Autowired
    private ElasticsearchTemplate template;

    @Override
    public void saveOrUpdate(TravelTemplate template) {
        repository.save(template);
    }

    @Override
    public List<TravelTemplate> getTravelByDestName(String destName) {
        return repository.findByDestName(destName);
    }
}
